home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_DrawPrevNext.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  1KB  |  64 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. #ifdef DO_TAPEDECK_KIND
  10. VOID __regargs
  11. LTP_DrawPrevNext(struct RastPort *RPort,BOOLEAN Prev,LONG Left,LONG Top,LONG Width,LONG Height)
  12. {
  13.     LONG i,Len,Start,ArrowWidth,ArrowHeight,LineWidth;
  14.  
  15.     LineWidth    = (Width + 15) / 16;
  16.     ArrowWidth    = Width;
  17.     ArrowHeight    = Height;
  18.     Left        = Left - (LineWidth / 2);
  19.  
  20.     if(Prev)
  21.     {
  22.         for(i = 0 ; i < ArrowWidth ; i++)
  23.         {
  24.             Len    = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  25.  
  26.             if(Len < ArrowHeight)
  27.                 Len++;
  28.  
  29.             Start    = Top + (ArrowHeight - Len) / 2;
  30.  
  31.             Move(RPort,Left + i,Start);
  32.             Draw(RPort,Left + i,Start + Len - 1);
  33.         }
  34.  
  35.         for(i = 0 ; i < LineWidth ; i++)
  36.         {
  37.             Move(RPort,Left + i,Top);
  38.             Draw(RPort,Left + i,Top + Height - 1);
  39.         }
  40.     }
  41.     else
  42.     {
  43.         for(i = 0 ; i < ArrowWidth ; i++)
  44.         {
  45.             Len    = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  46.  
  47.             if(Len < ArrowHeight)
  48.                 Len++;
  49.  
  50.             Start    = Top + (ArrowHeight - Len) / 2;
  51.  
  52.             Move(RPort,Left + ArrowWidth - 1 - i,Start);
  53.             Draw(RPort,Left + ArrowWidth - 1 - i,Start + Len - 1);
  54.         }
  55.  
  56.         for(i = 0 ; i < LineWidth ; i++)
  57.         {
  58.             Move(RPort,Left + ArrowWidth - 1 - i,Top);
  59.             Draw(RPort,Left + ArrowWidth - 1 - i,Top + Height - 1);
  60.         }
  61.     }
  62. }
  63. #endif    /* DO_TAPEDECK_KIND */
  64.